package main

import "fmt"

func main() {
	//teacher
	//年龄  姓名  电话
	//数据嵌套
	// map, map[string]int   map[string]map[string]string
	// [1,2,3,4,5]

	//1.宫保鸡丁:45 糖醋鱼: 80
	//2.糖醋里脊: 55 回锅肉: 50
	//3.奶茶: 20    啤酒: 10
	//[]map[string]int   切片
	order := []map[string]int{
		{
			"宫保鸡丁": 45,
		},
		{
			"糖醋里脊": 55,
		},
	}
	fmt.Println(order)
	order1 := map[string]int{
		"宫保鸡丁": 45,
		"糖醋鱼":  80,
	}
	order2 := map[string]int{
		"糖醋里脊": 55,
		"回锅肉":  50,
	}
	order3 := map[string]int{
		"奶茶": 20,
		"啤酒": 10,
	}
	var menu []map[string]int
	menu = append(menu, order1, order2, order3)
	fmt.Println(menu)
	for k, v := range menu {
		fmt.Println("第", k+1, "天的菜单")
		for k1, v1 := range v {
			fmt.Println(k1, v1)
		}

	}
	/*
		[map[宫保鸡丁:45 糖醋鱼:80] map[回锅肉:50 糖醋里脊:55] map[啤酒:10 奶茶:20]]
									第 1 天的菜单
									宫保鸡丁 45
									糖醋鱼 80
									第 2 天的菜单
									糖醋里脊 55
									回锅肉 50
									第 3 天的菜单
									奶茶 20
									啤酒 10
	*/

	//对象嵌套对象
	//map[string]map[string]string
	info := map[string]map[string]string{
		"杨晓燕": {
			"浙江": "杭州",
		},
		"杨旭": {
			"江苏": "连云港",
		},
	}
	fmt.Println(info)
	for k, v := range info {
		fmt.Println(k)
		fmt.Println(v["江苏"])

	}
	fmt.Println(info["杨晓燕"]["浙江"])
}
